package com.itunion.ddd.infra.convertor;


import com.itunion.ddd.domain.item.TbItemCategory;
import com.itunion.ddd.infra.gateway.database.dataobject.TbItemCategoryDO;
import org.springframework.beans.BeanUtils;

public class TbItemCategoryInfraConverter {

    public static TbItemCategory toTbItemCategory(TbItemCategoryDO tbItemCategoryDO){
        TbItemCategory tbItemCategory = new TbItemCategory();
        BeanUtils.copyProperties(tbItemCategoryDO, tbItemCategory);
        return tbItemCategory;
    }

    public static TbItemCategoryDO toTbItemCategoryDO(TbItemCategory tbItemCategory){
        TbItemCategoryDO tbItemCategoryDO = new TbItemCategoryDO();
        BeanUtils.copyProperties(tbItemCategory, tbItemCategoryDO);
        return tbItemCategoryDO;
    }
}
